package functions 
{	import functions.FunctionNode;	/**	 * @author admin	 */	public class RandomFunctionNode extends FunctionNode 
	{
		public function RandomFunctionNode()
		{
			funcname = "random";	
			functiontype = FUNCTION;
		}
		
		override public function getValue( args : XML, scope : Object ) : XML
		{

			var returnXML : XML;
			
			var returnValue : Number = Math.random() * Evaluator.getLiteral(Evaluator.evaluate(args.children()[ 0 ], scope));
				
			returnXML = <numberliteral>{returnValue}</numberliteral>;

			return returnXML;
		}	}}